/*
 * four_diodes.c
 *
 *  Created on: Jun 8, 2010
 *      Author: Armen Nazarian
 */

#include <includes.h>
#include "../app_safetrucking_cfg.h"

void  diode_one(void *p_arg)
{
	INT8U *err;
    (void)p_arg;
    while(1) {
		OSSemPend(diode_one_start, 0, err);
		diode1_toggle(); //turn diode on

		OSSemPend(diode_one_stop, 15000, err);
		diode1_toggle();//turn diode off

    }
}

void  diode_two(void *p_arg)
{
	INT8U *err;
    (void)p_arg;
    while(1) {
		OSSemPend(diode_two_start, 0, err);
		diode2_toggle(); //turn diode on
		OSSemPend(diode_two_stop, 15000, err);
		diode2_toggle();//turn diode off

    }
}

void  diode_three(void *p_arg)
{
	INT8U *err;
    (void)p_arg;
    while(1) {
		OSSemPend(diode_three_start, 0, err);
		diode3_toggle(); //turn diode on

		OSSemPend(diode_three_stop, 15000, err);
		diode3_toggle();//turn diode off

    }
}
void  diode_forth(void *p_arg)
{
	INT8U *err;
    (void)p_arg;
    while(1) {
		OSSemPend(diode_forth_start, 0, err);
		diode4_toggle(); //turn diode on

		OSSemPend(diode_forth_stop, 15000, err);
		diode4_toggle();//turn diode off

    }
}
